package nl.zoidberg.calculon.util;

import nl.zoidberg.calculon.engine.Board;


public class KnightMoveBitmapGen {

	public static int[][] MOVES = new int[][] {
		{ 1, 2 }, 	{ 1, -2 },
		{ -1, 2 }, 	{ -1, -2 },
		{ 2, 1 },	{ 2, -1 },
		{ -2, 1 },	{ -2, -1 },
	};

	public static void main(String[] args) {
		for(int file = 0; file < 8; file++) {
			for(int rank = 0; rank < 8; rank++) {
				long bitmap = 0;
				for(int[] move: MOVES) {
					int nFile = file + move[0];
					int nRank = rank + move[1];
					if(Board.isOnBoard(nFile, nRank)) {
						bitmap |= 1L<<(nRank<<3)<<nFile;
					}
				}
				System.out.println("\t\tkm2Bitmap[" + (rank<<3|file) + "] = " + bitmap + "L;");
				// System.out.println(BitBoard.toPrettyString(bitmap));
			}
		}
	}
}
